package com.study.d022transform;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.scene.transform.Affine;
import javafx.scene.transform.Shear;
import javafx.stage.Stage;

/**Transform接口之子类  Affine的使用
 * Affine类用于仿射变换
*@description
*@author xtayhame
*date 2020年3月17日
*version
*since v1.0
*/
public class AffineMain extends Application{
	public static void main(String[] args) {
		launch(args);
	}
	@Override
	public void start(Stage stage) throws Exception {
		AnchorPane anchorPane = new AnchorPane();


		AnchorPane  pane = new AnchorPane();
		pane.setPrefWidth(600);
		pane.setPrefHeight(500);
		pane.setStyle("-fx-background-color:#FFF987");

		AnchorPane.setTopAnchor(pane, 100.0);
		AnchorPane.setLeftAnchor(pane, 100.0);

		anchorPane.getChildren().add(pane);
		stage.setScene(new Scene(anchorPane));
		stage.setWidth(800);
		stage.setHeight(700);
		stage.show();

		//
		Button b1 = new Button("第一个按钮");
		b1.setPrefSize(100, 100);
		pane.getChildren().add(b1);

		Button b2 = new Button("第二个按钮");
		b2.setPrefSize(100, 100);
		pane.getChildren().add(b2);

		//设置一下透明度
		b2.setOpacity(0.4);

		Affine affine= new Affine(40, 50, 60, 70, 30, 80);
		b2.getTransforms().add(affine);


	}
}
